import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { MainComponent } from './main-module/main.module';
import {LearnComponent} from './main-module/views/learn/learn.component';
import {LifeComponent} from './main-module/views/life/life.component';
import {MessageBoardComponent} from './main-module/views/message-board/message-board.component';
import {HomeComponent} from './main-module/views/home/home.component';

const routes: Routes = [{
  path: 'main',
  component: MainComponent,
  children: [{
    path: 'home',
    component: HomeComponent,
    data: {
      breadcrumb: 'Home'
    }
  }, {
    path: 'learn',
    component: LearnComponent,
    data: {
      breadcrumb: 'Learn'
    }
  }, {
    path: 'life',
    component: LifeComponent,
    data: {
      breadcrumb: 'Life'
    }
  }, {
    path: 'msg-board',
    component: MessageBoardComponent,
    data: {
      breadcrumb: 'Message Board'
    }
  }, {
    path: 'manager',
    loadChildren: () => import('./manager-module/manager.module').then(mod => mod.ManagerModule),
  }]
}, {
  path: '**',
  redirectTo: 'main/home'
}];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
